cmake_minimum_required(VERSION 3.5)
project(CA)

set(CMAKE_CXX_STANDARD 11)

if (CMAKE_VERSION VERSION_GREATER 2.8.11)
    set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} " -pthread")
else()
    set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} " -std=c++11 -pthread")
endif()

set(SOURCE_FILES
        Mavlink/common/common.h
        Mavlink/common/common.hpp
        Mavlink/common/gtestsuite.hpp
        Mavlink/common/mavlink.h
        Mavlink/common/mavlink_msg_actuator_control_target.h
        Mavlink/common/mavlink_msg_actuator_control_target.hpp
        Mavlink/common/mavlink_msg_adsb_vehicle.h
        Mavlink/common/mavlink_msg_adsb_vehicle.hpp
        Mavlink/common/mavlink_msg_altitude.h
        Mavlink/common/mavlink_msg_altitude.hpp
        Mavlink/common/mavlink_msg_att_pos_mocap.h
        Mavlink/common/mavlink_msg_att_pos_mocap.hpp
        Mavlink/common/mavlink_msg_attitude.h
        Mavlink/common/mavlink_msg_attitude.hpp
        Mavlink/common/mavlink_msg_attitude_quaternion.h
        Mavlink/common/mavlink_msg_attitude_quaternion.hpp
        Mavlink/common/mavlink_msg_attitude_quaternion_cov.h
        Mavlink/common/mavlink_msg_attitude_quaternion_cov.hpp
        Mavlink/common/mavlink_msg_attitude_target.h
        Mavlink/common/mavlink_msg_attitude_target.hpp
        Mavlink/common/mavlink_msg_auth_key.h
        Mavlink/common/mavlink_msg_auth_key.hpp
        Mavlink/common/mavlink_msg_autopilot_version.h
        Mavlink/common/mavlink_msg_autopilot_version.hpp
        Mavlink/common/mavlink_msg_battery_status.h
        Mavlink/common/mavlink_msg_battery_status.hpp
        Mavlink/common/mavlink_msg_button_change.h
        Mavlink/common/mavlink_msg_button_change.hpp
        Mavlink/common/mavlink_msg_camera_capture_status.h
        Mavlink/common/mavlink_msg_camera_capture_status.hpp
        Mavlink/common/mavlink_msg_camera_image_captured.h
        Mavlink/common/mavlink_msg_camera_image_captured.hpp
        Mavlink/common/mavlink_msg_camera_information.h
        Mavlink/common/mavlink_msg_camera_information.hpp
        Mavlink/common/mavlink_msg_camera_settings.h
        Mavlink/common/mavlink_msg_camera_settings.hpp
        Mavlink/common/mavlink_msg_camera_trigger.h
        Mavlink/common/mavlink_msg_camera_trigger.hpp
        Mavlink/common/mavlink_msg_change_operator_control.h
        Mavlink/common/mavlink_msg_change_operator_control.hpp
        Mavlink/common/mavlink_msg_change_operator_control_ack.h
        Mavlink/common/mavlink_msg_change_operator_control_ack.hpp
        Mavlink/common/mavlink_msg_collision.h
        Mavlink/common/mavlink_msg_collision.hpp
        Mavlink/common/mavlink_msg_command_ack.h
        Mavlink/common/mavlink_msg_command_ack.hpp
        Mavlink/common/mavlink_msg_command_int.h
        Mavlink/common/mavlink_msg_command_int.hpp
        Mavlink/common/mavlink_msg_command_long.h
        Mavlink/common/mavlink_msg_command_long.hpp
        Mavlink/common/mavlink_msg_control_system_state.h
        Mavlink/common/mavlink_msg_control_system_state.hpp
        Mavlink/common/mavlink_msg_data_stream.h
        Mavlink/common/mavlink_msg_data_stream.hpp
        Mavlink/common/mavlink_msg_data_transmission_handshake.h
        Mavlink/common/mavlink_msg_data_transmission_handshake.hpp
        Mavlink/common/mavlink_msg_debug.h
        Mavlink/common/mavlink_msg_debug.hpp
        Mavlink/common/mavlink_msg_debug_vect.h
        Mavlink/common/mavlink_msg_debug_vect.hpp
        Mavlink/common/mavlink_msg_distance_sensor.h
        Mavlink/common/mavlink_msg_distance_sensor.hpp
        Mavlink/common/mavlink_msg_encapsulated_data.h
        Mavlink/common/mavlink_msg_encapsulated_data.hpp
        Mavlink/common/mavlink_msg_estimator_status.h
        Mavlink/common/mavlink_msg_estimator_status.hpp
        Mavlink/common/mavlink_msg_extended_sys_state.h
        Mavlink/common/mavlink_msg_extended_sys_state.hpp
        Mavlink/common/mavlink_msg_file_transfer_protocol.h
        Mavlink/common/mavlink_msg_file_transfer_protocol.hpp
        Mavlink/common/mavlink_msg_flight_information.h
        Mavlink/common/mavlink_msg_flight_information.hpp
        Mavlink/common/mavlink_msg_follow_target.h
        Mavlink/common/mavlink_msg_follow_target.hpp
        Mavlink/common/mavlink_msg_global_position_int.h
        Mavlink/common/mavlink_msg_global_position_int.hpp
        Mavlink/common/mavlink_msg_global_position_int_cov.h
        Mavlink/common/mavlink_msg_global_position_int_cov.hpp
        Mavlink/common/mavlink_msg_global_vision_position_estimate.h
        Mavlink/common/mavlink_msg_global_vision_position_estimate.hpp
        Mavlink/common/mavlink_msg_gps2_raw.h
        Mavlink/common/mavlink_msg_gps2_raw.hpp
        Mavlink/common/mavlink_msg_gps2_rtk.h
        Mavlink/common/mavlink_msg_gps2_rtk.hpp
        Mavlink/common/mavlink_msg_gps_global_origin.h
        Mavlink/common/mavlink_msg_gps_global_origin.hpp
        Mavlink/common/mavlink_msg_gps_inject_data.h
        Mavlink/common/mavlink_msg_gps_inject_data.hpp
        Mavlink/common/mavlink_msg_gps_input.h
        Mavlink/common/mavlink_msg_gps_input.hpp
        Mavlink/common/mavlink_msg_gps_raw_int.h
        Mavlink/common/mavlink_msg_gps_raw_int.hpp
        Mavlink/common/mavlink_msg_gps_rtcm_data.h
        Mavlink/common/mavlink_msg_gps_rtcm_data.hpp
        Mavlink/common/mavlink_msg_gps_rtk.h
        Mavlink/common/mavlink_msg_gps_rtk.hpp
        Mavlink/common/mavlink_msg_gps_status.h
        Mavlink/common/mavlink_msg_gps_status.hpp
        Mavlink/common/mavlink_msg_heartbeat.h
        Mavlink/common/mavlink_msg_heartbeat.hpp
        Mavlink/common/mavlink_msg_high_latency.h
        Mavlink/common/mavlink_msg_high_latency.hpp
        Mavlink/common/mavlink_msg_highres_imu.h
        Mavlink/common/mavlink_msg_highres_imu.hpp
        Mavlink/common/mavlink_msg_hil_actuator_controls.h
        Mavlink/common/mavlink_msg_hil_actuator_controls.hpp
        Mavlink/common/mavlink_msg_hil_controls.h
        Mavlink/common/mavlink_msg_hil_controls.hpp
        Mavlink/common/mavlink_msg_hil_gps.h
        Mavlink/common/mavlink_msg_hil_gps.hpp
        Mavlink/common/mavlink_msg_hil_optical_flow.h
        Mavlink/common/mavlink_msg_hil_optical_flow.hpp
        Mavlink/common/mavlink_msg_hil_rc_inputs_raw.h
        Mavlink/common/mavlink_msg_hil_rc_inputs_raw.hpp
        Mavlink/common/mavlink_msg_hil_sensor.h
        Mavlink/common/mavlink_msg_hil_sensor.hpp
        Mavlink/common/mavlink_msg_hil_state.h
        Mavlink/common/mavlink_msg_hil_state.hpp
        Mavlink/common/mavlink_msg_hil_state_quaternion.h
        Mavlink/common/mavlink_msg_hil_state_quaternion.hpp
        Mavlink/common/mavlink_msg_home_position.h
        Mavlink/common/mavlink_msg_home_position.hpp
        Mavlink/common/mavlink_msg_landing_target.h
        Mavlink/common/mavlink_msg_landing_target.hpp
        Mavlink/common/mavlink_msg_local_position_ned.h
        Mavlink/common/mavlink_msg_local_position_ned.hpp
        Mavlink/common/mavlink_msg_local_position_ned_cov.h
        Mavlink/common/mavlink_msg_local_position_ned_cov.hpp
        Mavlink/common/mavlink_msg_local_position_ned_system_global_offset.h
        Mavlink/common/mavlink_msg_local_position_ned_system_global_offset.hpp
        Mavlink/common/mavlink_msg_log_data.h
        Mavlink/common/mavlink_msg_log_data.hpp
        Mavlink/common/mavlink_msg_log_entry.h
        Mavlink/common/mavlink_msg_log_entry.hpp
        Mavlink/common/mavlink_msg_log_erase.h
        Mavlink/common/mavlink_msg_log_erase.hpp
        Mavlink/common/mavlink_msg_log_request_data.h
        Mavlink/common/mavlink_msg_log_request_data.hpp
        Mavlink/common/mavlink_msg_log_request_end.h
        Mavlink/common/mavlink_msg_log_request_end.hpp
        Mavlink/common/mavlink_msg_log_request_list.h
        Mavlink/common/mavlink_msg_log_request_list.hpp
        Mavlink/common/mavlink_msg_logging_ack.h
        Mavlink/common/mavlink_msg_logging_ack.hpp
        Mavlink/common/mavlink_msg_logging_data.h
        Mavlink/common/mavlink_msg_logging_data.hpp
        Mavlink/common/mavlink_msg_logging_data_acked.h
        Mavlink/common/mavlink_msg_logging_data_acked.hpp
        Mavlink/common/mavlink_msg_manual_control.h
        Mavlink/common/mavlink_msg_manual_control.hpp
        Mavlink/common/mavlink_msg_manual_setpoint.h
        Mavlink/common/mavlink_msg_manual_setpoint.hpp
        Mavlink/common/mavlink_msg_memory_vect.h
        Mavlink/common/mavlink_msg_memory_vect.hpp
        Mavlink/common/mavlink_msg_message_interval.h
        Mavlink/common/mavlink_msg_message_interval.hpp
        Mavlink/common/mavlink_msg_mission_ack.h
        Mavlink/common/mavlink_msg_mission_ack.hpp
        Mavlink/common/mavlink_msg_mission_clear_all.h
        Mavlink/common/mavlink_msg_mission_clear_all.hpp
        Mavlink/common/mavlink_msg_mission_count.h
        Mavlink/common/mavlink_msg_mission_count.hpp
        Mavlink/common/mavlink_msg_mission_current.h
        Mavlink/common/mavlink_msg_mission_current.hpp
        Mavlink/common/mavlink_msg_mission_item.h
        Mavlink/common/mavlink_msg_mission_item.hpp
        Mavlink/common/mavlink_msg_mission_item_int.h
        Mavlink/common/mavlink_msg_mission_item_int.hpp
        Mavlink/common/mavlink_msg_mission_item_reached.h
        Mavlink/common/mavlink_msg_mission_item_reached.hpp
        Mavlink/common/mavlink_msg_mission_request.h
        Mavlink/common/mavlink_msg_mission_request.hpp
        Mavlink/common/mavlink_msg_mission_request_int.h
        Mavlink/common/mavlink_msg_mission_request_int.hpp
        Mavlink/common/mavlink_msg_mission_request_list.h
        Mavlink/common/mavlink_msg_mission_request_list.hpp
        Mavlink/common/mavlink_msg_mission_request_partial_list.h
        Mavlink/common/mavlink_msg_mission_request_partial_list.hpp
        Mavlink/common/mavlink_msg_mission_set_current.h
        Mavlink/common/mavlink_msg_mission_set_current.hpp
        Mavlink/common/mavlink_msg_mission_write_partial_list.h
        Mavlink/common/mavlink_msg_mission_write_partial_list.hpp
        Mavlink/common/mavlink_msg_mount_orientation.h
        Mavlink/common/mavlink_msg_mount_orientation.hpp
        Mavlink/common/mavlink_msg_named_value_float.h
        Mavlink/common/mavlink_msg_named_value_float.hpp
        Mavlink/common/mavlink_msg_named_value_int.h
        Mavlink/common/mavlink_msg_named_value_int.hpp
        Mavlink/common/mavlink_msg_nav_controller_output.h
        Mavlink/common/mavlink_msg_nav_controller_output.hpp
        Mavlink/common/mavlink_msg_optical_flow.h
        Mavlink/common/mavlink_msg_optical_flow.hpp
        Mavlink/common/mavlink_msg_optical_flow_rad.h
        Mavlink/common/mavlink_msg_optical_flow_rad.hpp
        Mavlink/common/mavlink_msg_param_map_rc.h
        Mavlink/common/mavlink_msg_param_map_rc.hpp
        Mavlink/common/mavlink_msg_param_request_list.h
        Mavlink/common/mavlink_msg_param_request_list.hpp
        Mavlink/common/mavlink_msg_param_request_read.h
        Mavlink/common/mavlink_msg_param_request_read.hpp
        Mavlink/common/mavlink_msg_param_set.h
        Mavlink/common/mavlink_msg_param_set.hpp
        Mavlink/common/mavlink_msg_param_value.h
        Mavlink/common/mavlink_msg_param_value.hpp
        Mavlink/common/mavlink_msg_ping.h
        Mavlink/common/mavlink_msg_ping.hpp
        Mavlink/common/mavlink_msg_play_tune.h
        Mavlink/common/mavlink_msg_play_tune.hpp
        Mavlink/common/mavlink_msg_position_target_global_int.h
        Mavlink/common/mavlink_msg_position_target_global_int.hpp
        Mavlink/common/mavlink_msg_position_target_local_ned.h
        Mavlink/common/mavlink_msg_position_target_local_ned.hpp
        Mavlink/common/mavlink_msg_power_status.h
        Mavlink/common/mavlink_msg_power_status.hpp
        Mavlink/common/mavlink_msg_radio_status.h
        Mavlink/common/mavlink_msg_radio_status.hpp
        Mavlink/common/mavlink_msg_raw_imu.h
        Mavlink/common/mavlink_msg_raw_imu.hpp
        Mavlink/common/mavlink_msg_raw_pressure.h
        Mavlink/common/mavlink_msg_raw_pressure.hpp
        Mavlink/common/mavlink_msg_rc_channels.h
        Mavlink/common/mavlink_msg_rc_channels.hpp
        Mavlink/common/mavlink_msg_rc_channels_override.h
        Mavlink/common/mavlink_msg_rc_channels_override.hpp
        Mavlink/common/mavlink_msg_rc_channels_raw.h
        Mavlink/common/mavlink_msg_rc_channels_raw.hpp
        Mavlink/common/mavlink_msg_rc_channels_scaled.h
        Mavlink/common/mavlink_msg_rc_channels_scaled.hpp
        Mavlink/common/mavlink_msg_request_data_stream.h
        Mavlink/common/mavlink_msg_request_data_stream.hpp
        Mavlink/common/mavlink_msg_resource_request.h
        Mavlink/common/mavlink_msg_resource_request.hpp
        Mavlink/common/mavlink_msg_safety_allowed_area.h
        Mavlink/common/mavlink_msg_safety_allowed_area.hpp
        Mavlink/common/mavlink_msg_safety_set_allowed_area.h
        Mavlink/common/mavlink_msg_safety_set_allowed_area.hpp
        Mavlink/common/mavlink_msg_scaled_imu.h
        Mavlink/common/mavlink_msg_scaled_imu.hpp
        Mavlink/common/mavlink_msg_scaled_imu2.h
        Mavlink/common/mavlink_msg_scaled_imu2.hpp
        Mavlink/common/mavlink_msg_scaled_imu3.h
        Mavlink/common/mavlink_msg_scaled_imu3.hpp
        Mavlink/common/mavlink_msg_scaled_pressure.h
        Mavlink/common/mavlink_msg_scaled_pressure.hpp
        Mavlink/common/mavlink_msg_scaled_pressure2.h
        Mavlink/common/mavlink_msg_scaled_pressure2.hpp
        Mavlink/common/mavlink_msg_scaled_pressure3.h
        Mavlink/common/mavlink_msg_scaled_pressure3.hpp
        Mavlink/common/mavlink_msg_serial_control.h
        Mavlink/common/mavlink_msg_serial_control.hpp
        Mavlink/common/mavlink_msg_servo_output_raw.h
        Mavlink/common/mavlink_msg_servo_output_raw.hpp
        Mavlink/common/mavlink_msg_set_actuator_control_target.h
        Mavlink/common/mavlink_msg_set_actuator_control_target.hpp
        Mavlink/common/mavlink_msg_set_attitude_target.h
        Mavlink/common/mavlink_msg_set_attitude_target.hpp
        Mavlink/common/mavlink_msg_set_gps_global_origin.h
        Mavlink/common/mavlink_msg_set_gps_global_origin.hpp
        Mavlink/common/mavlink_msg_set_home_position.h
        Mavlink/common/mavlink_msg_set_home_position.hpp
        Mavlink/common/mavlink_msg_set_mode.h
        Mavlink/common/mavlink_msg_set_mode.hpp
        Mavlink/common/mavlink_msg_set_position_target_global_int.h
        Mavlink/common/mavlink_msg_set_position_target_global_int.hpp
        Mavlink/common/mavlink_msg_set_position_target_local_ned.h
        Mavlink/common/mavlink_msg_set_position_target_local_ned.hpp
        Mavlink/common/mavlink_msg_setup_signing.h
        Mavlink/common/mavlink_msg_setup_signing.hpp
        Mavlink/common/mavlink_msg_sim_state.h
        Mavlink/common/mavlink_msg_sim_state.hpp
        Mavlink/common/mavlink_msg_statustext.h
        Mavlink/common/mavlink_msg_statustext.hpp
        Mavlink/common/mavlink_msg_storage_information.h
        Mavlink/common/mavlink_msg_storage_information.hpp
        Mavlink/common/mavlink_msg_sys_status.h
        Mavlink/common/mavlink_msg_sys_status.hpp
        Mavlink/common/mavlink_msg_system_time.h
        Mavlink/common/mavlink_msg_system_time.hpp
        Mavlink/common/mavlink_msg_terrain_check.h
        Mavlink/common/mavlink_msg_terrain_check.hpp
        Mavlink/common/mavlink_msg_terrain_data.h
        Mavlink/common/mavlink_msg_terrain_data.hpp
        Mavlink/common/mavlink_msg_terrain_report.h
        Mavlink/common/mavlink_msg_terrain_report.hpp
        Mavlink/common/mavlink_msg_terrain_request.h
        Mavlink/common/mavlink_msg_terrain_request.hpp
        Mavlink/common/mavlink_msg_timesync.h
        Mavlink/common/mavlink_msg_timesync.hpp
        Mavlink/common/mavlink_msg_v2_extension.h
        Mavlink/common/mavlink_msg_v2_extension.hpp
        Mavlink/common/mavlink_msg_vfr_hud.h
        Mavlink/common/mavlink_msg_vfr_hud.hpp
        Mavlink/common/mavlink_msg_vibration.h
        Mavlink/common/mavlink_msg_vibration.hpp
        Mavlink/common/mavlink_msg_vicon_position_estimate.h
        Mavlink/common/mavlink_msg_vicon_position_estimate.hpp
        Mavlink/common/mavlink_msg_vision_position_estimate.h
        Mavlink/common/mavlink_msg_vision_position_estimate.hpp
        Mavlink/common/mavlink_msg_vision_speed_estimate.h
        Mavlink/common/mavlink_msg_vision_speed_estimate.hpp
        Mavlink/common/mavlink_msg_wind_cov.h
        Mavlink/common/mavlink_msg_wind_cov.hpp
        Mavlink/common/testsuite.h
        Mavlink/common/version.h
        Mavlink/checksum.h
        Mavlink/mavlink_conversions.h
        Mavlink/mavlink_get_info.h
        Mavlink/mavlink_helpers.h
        Mavlink/mavlink_sha256.h
        Mavlink/mavlink_types.h
        Mavlink/message.hpp
        Mavlink/msgmap.hpp
        Mavlink/protocol.h

        serial_port.h serial_port.cpp 
	CA.cpp CA.h 
	autopilot_interface.h autopilot_interface.cpp
	)

add_executable(CA ${SOURCE_FILES}
        serial_port.h serial_port.cpp
	autopilot_interface.h autopilot_interface.cpp
        CA.h CA.cpp
        )
